<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>衣服</title>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/det.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/css.css">
</head>
<include file="Public:left"/>
<body>
<div id="cont">
    <include file="Public:head" />
    <div id="main">
        <div id="mat">
            <volist name="good_es" id="vo">
                <img src="{$vo.goods_pic}">
                <span>
                <h2>{$vo.goods_title}</h2>
                <div id="desc">
                <font>{$vo.goods_desc}</font>
                <p>价格：￥{$vo.goods_price}元</p>
                </div>
                <div id="pay">
                <a href="__MODULE__/Payment/payment/id/{$vo.id}">购买</a>&nbsp;&nbsp;<a id="addCart" href="javascript:;">加入购物车</a>
                </div>
            </span>
            </volist>
        </div>
        <div id="stand">
            <volist name="good" id="vo">
                <div class="show">
                    <h2><a href="__MODULE__/Details/details/id/{$vo.id}">{$vo.goods_title}</a></h2>
                    <a href="__MODULE__/Details/details/id/{$vo.id}"><img src="{$vo.goods_pic}"></a>
                    <p>价格：￥{$vo.goods_price}元</p>
                </div>
            </volist>
        </div>
    </div>
   <include file="Public:right" />
</div>
<include file="Public:footer"/>
</div>
</body>
<script src="__PUBLIC__/home/js/jquery-1.11.0.min.js"></script>
<script languge=javascript>
    // @TODO 添加购物车商品
    $(function () {
        var data = {};
        $('#addCart').click(function () {
            data.goods_id = window.location.href.substring(window.location.href.lastIndexOf('/') + 1);
            $.post("{:U('Cart/adCart')}", data, function (ret) {
                if (ret.code == 1) {
                    alert('添加购物车成功！');
                    history.go(0);
                    return false;
                }
                    alert('您还没登录！');
            })
        })
    })
</script>
</html>